   package com.javalong.affairs.module.notifything.activity;

import com.javalong.affairs.R;
import com.javalong.affairs.base.activity.UIHandlerActivity;
import com.javalong.affairs.base.constant.BundleKey;
import com.javalong.affairs.base.model.MessageInfo;
import com.javalong.affairs.base.ui.TopTitle;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;

import android.os.Bundle;
import android.widget.TextView;

@ContentView(R.layout.activity_editmsg2)
public class EditMsgActivity extends UIHandlerActivity {
	@ViewInject(R.id.tv_time)
	private TextView tv_time;
	@ViewInject(R.id.tv_address)
	private TextView tv_address;
	@ViewInject(R.id.tv_sender)
	private TextView tv_sender;
	@ViewInject(R.id.tv_receiver)
	private TextView tv_receiver;
	@ViewInject(R.id.tv_operation)
	private TextView tv_operation;
	@ViewInject(R.id.tv_content)
	private TextView tv_content;
	@ViewInject(R.id.tv_timelimit)
	private TextView tv_timelimit;
	@ViewInject(R.id.ui_toptitle)
	private TopTitle topTitle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ViewUtils.inject(this);
		Bundle bundle = getIntent().getBundleExtra(BundleKey.BUNDLE);
		MessageInfo msgInfo = (MessageInfo) bundle.get(BundleKey.MESSAGEINFO);
		if (msgInfo != null) {
			initUI(msgInfo);
		}
	}

	private void initUI(MessageInfo msgInfo) {
		tv_time.setText(msgInfo.time);
		tv_address.setText(msgInfo.place);
		tv_sender.setText(msgInfo.sender);
		topTitle.setOnLeftDrawableClick(this);
	}
}
